package com.woniuxy.bookmallmanagersrever.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(indexName="bookmall",shards = 3,replicas=2)
public class EsBook {
    @Id
    private Long id;
    @Field(value = "name",type= FieldType.Text,index = true,store = true,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String name;
    @Field(value = "typeid",type = FieldType.Integer,index = true,store = true)
    private Integer typeid;
    @Field(value = "typeName",type = FieldType.Keyword,index = true,store = true)
    private String typeName ;
    @Field(value = "publishdate",type = FieldType.Date,index = true,store = true)
    private Date publishdate;
    @Field(value = "provider",type= FieldType.Text,index = true,store = true,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String provider;
    @Field(value = "author",type = FieldType.Keyword,index = true,store = true)
    private String author;
    @Field(value = "price",type = FieldType.Double,index = true,store = true)
    private BigDecimal price;
    @Field(value = "collectioncount",type = FieldType.Integer,index = true,store = true)
    private Integer collectioncount;
    @Field(value = "storecount",type = FieldType.Integer,index = true,store = true)
    private Integer storecount;
    @Field(value = "buycount",type = FieldType.Integer,index = true,store = true)
    private Integer buycount;
    @Field(value = "readcount",type = FieldType.Integer,index = true,store = true)
    private Integer readcount;
    @Field(value = "createtime",type = FieldType.Date,index = true,store = true)
    private Date createtime;
    @Field(value = "updatetime",type = FieldType.Date,index = true,store = true)
    private Date updatetime;
    @Field(value = "state",type = FieldType.Integer,index = true,store = true)
    private Integer state;
    @Field(value = "detail",type= FieldType.Text,index = true,store = true,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String detail;
    @Field(value = "imgsrc",type = FieldType.Keyword,index = true,store = true)
    private String imgsrc;
}